<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title></title>
    <script th:src="@{/layui/layui.js}" type="text/javascript"></script>
    <link th:href="@{/layui/css/layui.css}" rel="stylesheet" />
</head>
<body>
<div class="layui-container" style="margin: 10px 0px; ">
    <form class="layui-form layui-form-pane">
        <input type="hidden" name="id" th:value="${mst.id}">
        <div class="layui-form-item">
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-block" style="width: 225px;">
                <input type="text" class="layui-input" name="username" style="cursor:not-allowed;color: #9F9F9F" disabled th:value="${mst.username}"   autocomplete="off" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">用户昵称</label>
            <div class="layui-input-block" style="width: 225px;">
                <input type="text" class="layui-input" name="user" style="cursor:not-allowed;color: #9F9F9F" disabled th:value="${mst.user}"   autocomplete="off" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">用户密码</label>
            <div class="layui-input-block" style="width: 225px;">
                <input type="password" class="layui-input" name="password" style="cursor:not-allowed;color: #9F9F9F" disabled th:value="${mst.password}"  autocomplete="off" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">用户手机</label>
            <div class="layui-input-block" style="width: 225px;">
                <input type="text" class="layui-input" name="phone" style="cursor:not-allowed;color: #9F9F9F" disabled  th:value="${mst.phone}" autocomplete="off" />
            </div>

        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">用户性别</label>
            <div class="layui-input-block" style="width: 150px;">
                <select  type="text" id="sex" class="layui-input"  name="sex" th:value="${mst.sex}" autocomplete="off" >
                    <option th:selected="${mst.sex}=='1'" value="1" >男</option>
                    <option th:selected="${mst.sex}=='2'" value="2" >女</option>
                    <option th:selected="${mst.sex}=='3'" value="3" >未知</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">用户等级</label>
            <div class="layui-input-block" style="width: 150px;">
                <select type="text" class="layui-select" id="level"   name="level" th:value="${mst.level}"  autocomplete="off">
                    <option th:selected="${mst.level}=='1'" value="1">普通用户</option>
                    <option th:selected="${mst.level}=='2'" value="2">会员用户</option>
                    <option th:selected="${mst.level}=='3'" value="3">高级会员用户</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block" style="width: 150px;">
                <select type="text" class="layui-input" name="status"  th:value="${mst.status}" autocomplete="off" >
                    <option th:selected="${mst.status}=='1'" value="1">可用</option>
                    <option th:selected="${mst.status}=='2'" value="2">禁用</option>
                    <option th:selected="${mst.status}=='3'" value="3">注销</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item" style="display: none;">
            <div class="layui-input-block">
                <a class="layui-btn" id="submitBtn" lay-submit="" lay-filter="submitBtn">提交</a>
            </div>
        </div>
    </form>
</div>
<script>

    var $;
    layui.use(['table','layer','form','jquery','dropdown','element'],function() {
        var table = layui.table,
            form = layui.form,
            element = layui.element,
            layer = layui.layer,
            dropdown= layui.dropdown;
        $ = layui.jquery;


        form.on('submit(submitBtn)',function (data) {
            var formData = data.field;
            $.ajax({
                type:'post',
                url:'/members/mcs/update',
                data:formData,
                dataType:'json',
                success:function (result) {
                    layer.msg(result.msg);
                    if(result.is){
                        let index = parent.layer.getFrameIndex(window.name);
                        parent.layer.close(index);//关闭父页面窗口
                    }
                }
            })
        });

        });
    function btnSubmit(){
        $('#submitBtn').click();
    }

</script>
</body>
</html>
